package com.wash.shoes.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.wash.shoes.entity.FactoryshelvesPo;

/**
 * 工厂货架Mapper
 */
@Mapper
public interface FactoryShelvesMapper extends BaseMapper<FactoryshelvesPo> {
    /**
     * 修改货架使用数量
     * 
     * @param factoryshelvesId 货架id
     * @return
     */
    @Update("update os_factoryshelves set use_num =(select count(1) from os_factoryshelves_rack_grid where factoryshelves_id=#{factoryshelves_id} and status='ONLINE' and order_id is not null )  where id = #{factoryshelves_id}")
    int updateUseNumInteger(@Param("factoryshelves_id") String factoryshelvesId);
}
